<template>
  <a-card :bordered="false">
    <detail-list title="导师信息">
      <detail-list-item term="导师编号">{{ teacherInfo.gh }}&emsp;</detail-list-item>
      <detail-list-item term="院系名称">{{ teacherInfo.ssyxmc }}&emsp;</detail-list-item>
      <detail-list-item term="姓名">{{ teacherInfo.xm }}&emsp;</detail-list-item>
      <detail-list-item term="性别">{{ teacherInfo.xbmc }}&emsp;</detail-list-item>
      <detail-list-item term="有无硕士生">{{ teacherInfo.sssCount }}&emsp;</detail-list-item>
      <detail-list-item term="有无博士生">{{ teacherInfo.bssCount }}&emsp;</detail-list-item>
      <detail-list-item term="出生日期">{{ teacherInfo.csrq && teacherInfo.csrq.format('YYYY-MM-DD') }}&emsp;</detail-list-item>
      <detail-list-item term="职称">{{ teacherInfo.zcmc }}&emsp;</detail-list-item>
      <detail-list-item term="最后学历">{{ teacherInfo.zhxlmc }}&emsp;</detail-list-item>
      <detail-list-item term="最后学位">{{ teacherInfo.zhxwmc }}&emsp;</detail-list-item>
      <detail-list-item term="毕业院校或机构">{{ teacherInfo.byxxmc }}&emsp;</detail-list-item>
      <detail-list-item term="毕业年月">{{ teacherInfo.byny && teacherInfo.byny.format('YYYYMM') }}&emsp;</detail-list-item>
      <detail-list-item term="身份证号">{{ teacherInfo.sfzjh }}&emsp;</detail-list-item>
      <detail-list-item term="导师类别">{{ teacherInfo.dslbmc }}&emsp;</detail-list-item>
      <detail-list-item term="批准年月">{{ teacherInfo.rdpzny }}&emsp;</detail-list-item>
      <!-- <detail-list-item term="现从事专业">&emsp;</detail-list-item> -->
      <detail-list-item term="是否在职">{{ teacherInfo.dqztmc }}&emsp;</detail-list-item>
      <detail-list-item term="电子邮箱">{{ teacherInfo.dzxx }}&emsp;</detail-list-item>
      <detail-list-item term="手机号码">{{ teacherInfo.lxdh }}&emsp;</detail-list-item>
      <detail-list-item term="办公电话">{{ teacherInfo.bgdh }}&emsp;</detail-list-item>
      <detail-list-item term="住宅电话">{{ teacherInfo.zzdh }}&emsp;</detail-list-item>
      <detail-list-item term="聘书发放时间">{{ teacherInfo.psffrq && teacherInfo.psffrq.format('YYYY-MM-DD') }}&emsp;</detail-list-item>
      <detail-list-item term="聘书终止日期">{{ teacherInfo.pszzrq && teacherInfo.pszzrq.format('YYYY-MM-DD') }}&emsp;</detail-list-item>
    </detail-list>
    <a-row style="margin:10px 0;color:rgba(0,0,0,.85)">指导专业及研究方向：</a-row>
    <a-row>
      <span style="color:rgba(0,0,0,.85)">指导专业：</span>{{ teacherInfo.zdzymc }} <br/>
      <span style="color:rgba(0,0,0,.85)">研究方向：</span>{{ teacherInfo.yjfxmc }}
    </a-row>
    <a-row style="margin:10px 0;color:rgba(0,0,0,.85)">导师简介：</a-row>
    <a-row>{{ teacherInfo.dsjj }}</a-row>
    <a-row style="text-align: center;">
      <a-button type="primary" @click="$router.back()">返回</a-button>
      <a-button type="primary" @click="exportPdf">打印</a-button>
    </a-row>
  </a-card>
</template>

<script>
import DetailList from '~/tool/DetailList'
const DetailListItem = DetailList.Item

export default {
  data () {
    return {
      teacherInfo: {}
    }
  },
  components: {
    DetailList,
    DetailListItem
  },
  created () {
    this.$api.teacher.teacherInfo({dsbh: this.$route.params.dsbh}).then(res => {
      this.teacherInfo = res.data
    })
  },
  methods: {
    exportPdf () {
      let fileName = this.teacherInfo.xm + '_导师详细信息.pdf'
      this.$downloadPdf('/teacher/dsxx/dsPirnt/' + this.teacherInfo.gh, {}, fileName)
    }
  }
}
</script>

<style>

</style>
